Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

Fixes #6014

Summary

This PR addresses the issue where MCP servers automatically start when the IDE loads, consuming significant memory with no way to disable them without removing the entire extension.

Changes

  • Modified ClineProvider to check the mcpEnabled setting before initializing MCP Hub
  • Updated McpHub constructor to accept an autoInitialize parameter (default true for backward compatibility)
  • Added enableServers() and disableServers() methods to McpHub for dynamic control
  • Updated webview message handler to enable/disable MCP servers when the setting changes
  • Added comprehensive test coverage for the new conditional initialization behavior

Behavior

  • When mcpEnabled is false (default), MCP servers will not start automatically
  • Users can toggle the setting to enable/disable MCP servers without restarting the extension
  • Existing installations maintain backward compatibility with the default behavior

Testing

  • Added unit tests to verify conditional initialization
  • Tests cover both enabled and disabled states
  • Tests verify dynamic enable/disable functionality

This implementation ensures that users have full control over MCP server initialization, preventing unwanted memory consumption while maintaining the ability to use MCP features when needed.


Important

This PR modifies MCP server initialization to respect the mcpEnabled setting, preventing automatic startup and allowing dynamic control via user settings.

  • Behavior:
    • ClineProvider now checks mcpEnabled setting before initializing MCP Hub.
    • McpHub constructor updated to accept autoInitialize parameter (default true).
    • enableServers() and disableServers() methods added to McpHub for dynamic control.
    • Webview message handler updated to enable/disable MCP servers based on setting changes.
  • Testing:
    • Added unit tests for conditional initialization in McpHub.spec.ts.
    • Tests cover both enabled and disabled states and dynamic enable/disable functionality.

This description was created by Ellipsis for 02bb864. You can customize this summary. It will automatically update as commits are pushed.

…ialization

- Add conditional initialization in ClineProvider based on mcpEnabled setting
- Update McpHub constructor to accept autoInitialize parameter
- Add enableServers() and disableServers() methods for dynamic control
- Handle mcpEnabled toggle in webview message handler
- Update tests to cover new behavior

Fixes #6014
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 15:03
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jul 21, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 21, 2025
@daniel-lxs
Copy link
Member

The issue isn't sufficiently scoped for Roomote to address it, closing

@daniel-lxs daniel-lxs closed this Jul 22, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Can't disable MCP servers without deleting RooCode

4 participants